import React, { Component } from 'react'
import { connect } from 'react-redux'
import { actionCreator } from '../../store/user'
import CardList from '../../component/cardList'

class Genius extends Component {
  componentDidMount() {
    this.props.list()
  }
  render() {
    const { listinfo } = this.props;
    return (
      <CardList
        listinfo={listinfo}
      ></CardList>
    )
  }
}
const mapState = (state) => ({
  listinfo: state.user.list
})
const mapDispatch = (dispatch) => ({
  list(){
    dispatch(actionCreator.list('genius'))
  }
})

export default connect(mapState, mapDispatch)(Genius)